import cv2
import numpy as np

girl = cv2.imread("../asset/girl.jpeg")

logo = np.zeros((200, 200, 3), np.uint8)
mask = np.zeros((200, 200), np.uint8)

logo[20:120, 20:120] = [0, 0, 255]
logo[80:180, 80:180] = [0, 255, 0]
mask[20:120, 20:120] = 255
mask[80:180, 80:180] = 255

m = cv2.bitwise_not(mask)
roi = girl[0:200, 0:200]
tmp = cv2.bitwise_and(roi, roi, mask=m)
dst = cv2.add(tmp, logo)
girl[0:200, 0:200] = dst
while True:
    cv2.imshow('girl', girl)
    key = cv2.waitKey(10)
    if key & 0xFF == ord('q'):
        break

cv2.destroyAllWindows()
